﻿using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.Filters;
using NLog;
using Nlog_demo.Models;
using System.Diagnostics;

namespace Nlog_demo.Controllers
{
    
    public class HomeController : Controller
    {
        private readonly Logger logger = LogManager.GetCurrentClassLogger();
        public HomeController()
        {
        }
        [CatchException]
        public IActionResult Index()
        {
            var a = "hello world";
            var b = Convert.ToInt32(a);
            return View();
        }

        public IActionResult Privacy()
        {
            return View();
        }

        [ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
        public IActionResult Error()
        {
            return View(new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier });
        }
    }
}